#!/usr/bin/env bash
# 22 3306 8080 2049NFS  6379 2375

ip=$1
port=$2
service=$3



cmd="sudo nmap --host-timeout 2000 -sS -Pn -n --open  -p $2 $1"
res=`eval $cmd`
ips=`echo $res | grep -E -o "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+"`
echo "满足ip $ips\n"
cmd="sh ../api/scan.sh $port \"$ips\" "
eval $cmd




